﻿using System;
using Autodesk.Revit.DB;

namespace SectionSignAndFilled.StairsRoomPlanSign.ModelLayer
{
	public class ReferencePacker
	{
		public XYZ UsePoint
		{
			get
			{
				return this.m_usePoint;
			}
		}

		public override bool Equals(object obj)
		{
			return obj != null && obj is ReferencePacker && ReferencePacker.m_usePointCompare.Equals(this.m_usePoint, (obj as ReferencePacker).m_usePoint);
		}

		public override int GetHashCode()
		{
			return -1;
		}

		public Line DimLine
		{
			get
			{
				return this.m_dimLine;
			}
		}

		public ReferencePacker(XYZ usePoint, XYZ useLineDriection, XYZ useOriginPoint = null)
		{
			this.m_usePoint = usePoint;
			this.m_originPoint = useOriginPoint;
			if (this.m_originPoint == null)
			{
				this.m_dimLine = Line.CreateBound(usePoint, usePoint.Add(-useLineDriection.Multiply(StaticResource.LineLengthForDimesion)));
				return;
			}
			this.m_dimLine = Line.CreateBound(this.m_originPoint, this.m_originPoint.Add(-useLineDriection.Multiply(StaticResource.LineLengthForDimesion)));
		}

		private XYZ m_usePoint;

		private XYZ m_originPoint;

		private static XYZCompare m_usePointCompare = new XYZCompare();

		private Line m_dimLine;
	}
}
